#!/bin/bash
echo -e "\033[33;1mclean classes\033[0m"
rm -rf  classes
echo -e "\033[34;1mcompile java\033[0m"
${JAVA_HOME}/bin/javac -cp src -encoding UTF-8 -d classes -sourcepath ./src src/org/btik/server/video/UDP2Main.java
echo -e "\033[32;1mbuild win_release\033[0m"
cp -rf src/light-video.properties out/win_release
cp -rf src/run.bat out/win_release
rm -rf out/win_release/SimpleVideoServer
cp -rf classes out/win_release/SimpleVideoServer
cd ./out
rm -rf win_release.zip
zip -q win_release.zip win_release/* -r
cd ../
ls -lh ./out/win_release.zip

echo -e "\033[32;1mbuild linux_release\033[0m"
cp -rf src/light-video.properties out/linux_release
cp -rf src/run.sh out/linux_release
rm -rf out/linux_release/SimpleVideoServer
cp -rf classes out/linux_release/SimpleVideoServer
cd ./out
rm -rf linux_release.tar.gz
tar -zcf  linux_release.tar.gz linux_release/*
cd ../
ls -lh ./out/linux_release.tar.gz

